/*
 * @Author: xiaozhuang-c-language 3535851673@qq.com
 * @Date: 2025-09-24 09:34:00
 * @LastEditors: xiaozhuang-c-language 3535851673@qq.com
 * @LastEditTime: 2025-09-24 15:00:33
 * @FilePath: /zhuang/restRPC_demo/server.cc
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#include"./include/rest_rpc.hpp"
#include "include/rest_rpc/rpc_server.h"
#include <thread>
#include<unistd.h>
struct service
{
    int add(rpc_conn conn,int x,int y)
    {
        std::cout << "come a req!" << std::endl;
        sleep(4);
        return x+y;
    }
};

int main()
{
    rpc_server server(8082,std::thread::hardware_concurrency());
    service s;
    server.register_handler("add",&service::add,&s);

    server.run();
    return 0;
}